package javacafe.action.workshop;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.event.SeminarDTO;
import javacafe.dto.event.WorkshopDTO;

import javacafe.serviceimple.WorkshopServiceImple;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BeforeUpdateWorkshopAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		ActionForward actfoward = new ActionForward();
		WorkshopServiceImple schservice = WorkshopServiceImple.getInstance();
		
		String workshop_no = request.getParameter("workshop_no");
		if(workshop_no==null){
			workshop_no = "0";
		}
		String today = request.getParameter("today");
		WorkshopDTO scdto = new WorkshopDTO();
		scdto.setWorkshop_no(Integer.parseInt(workshop_no));
		scdto = schservice.getWorkshop(scdto);
		
		request.setAttribute("workshopupdate", scdto);
		request.setAttribute("today", today);
		actfoward.setUrl("updateworkshopform");
		return actfoward;
	}

}
